<?
/**
 * 基类
 */

class Statics {
	static $rgx;					// 常用正则表达式
	static $target_arr;				// 目标窗体
	static $manager_level_arr;
	static $access_arr = array();	// 后台管理权限
	static $sysvar_type_arr = array(
		1	=> 'array',
		2	=> 'int',
		3	=> 'string',
	);
	/*static $mail = array(
		'host'		=> 'smtp.126.com',
		'port'		=> '25',
		'from'		=> 'testing119@126.com',
		'pass'		=> '111111',
		'fromName'	=> 'xiaowang',
		'replyto'	=> 'ibug119@qq.com',
	);*/
	static $prototype_type_arr;
	static $recommend_type_arr = array(
		'normal'	=> '普通',
		'new'		=> '新品',
		'good'		=> '精品',
		'hot'		=> '热卖',
	);
	static $label_type_arr = array(
		'0'		=> '自定义',
		'1'		=> '直降',
		'2'		=> '折扣',
	);
	static $recommend_style_arr = array(
		1	=> 'new',
		2	=> 'hot',
		3	=> 'good',
	);
	static $goods_weight_unit_arr = array(
		'g'		=> 'g',
		'kg'	=> 'kg',
		't'		=> 't',
	);
	static $goods_quantity_unit_arr = array(
		'j'		=> '件',
		'g'		=> '个',
		'b'		=> '包',
		'h'		=> '盒',
		'l'		=> '条',
		't'		=> '套',
		'z'		=> '张',
		'o'		=> '头',
		'a'		=> '把',
		'z'		=> '枝',
		'd'		=> '朵',
		'm'		=> '米',
	);
	static $delivery_date_arr = array(
		'all'		=> '全部，周一至周日',
		'workday'	=> '工作日，周一至周五',
		'weekend'	=> '双休日，周六、周日',
		//'custom'	=> '自定义',
	);
	static $weekday_arr = array(
		1		=> '一',
		2		=> '二',
		3		=> '三',
		4		=> '四',
		5		=> '五',
		6		=> '六',
		7		=> '日',
	);
	static $income_arr = array(
		0	=> '无收入',
		1	=> '2000元以下',
		2	=> '2000-3999元',
		4	=> '4000-5999元',
		6	=> '6000-7999元',
		8	=> '8000元以上',
	);
	
	static $order_dir_arr = array(
		'ASC'	=> '递增',
		'DESC'	=> '递减'
	);
	static $super_agency_mapping_arr = array(
		'0'		=> array(),
		'1'		=> array(1),
		'2'		=> array(2),
		'3'		=> array(1, 2),
		'4'		=> array(4),
		'5'		=> array(1, 4),
		'6'		=> array(2, 4),
		'7'		=> array(1, 2, 4),
		
		'8'		=> array(8),
		'9'		=> array(1, 8),
		'10'	=> array(2, 8),
		'11'	=> array(1, 2, 8),
		'12'	=> array(4, 8),
		'13'	=> array(1, 4, 8),
		'14'	=> array(2, 4, 8),
		'15'	=> array(1, 2, 4, 8),
		
		'16'	=> array(16),
		'17'	=> array(1, 16),
		'18'	=> array(2, 16),
		'19'	=> array(1, 2, 16),
		'20'	=> array(4, 16),
		'21'	=> array(1, 4, 16),
		'22'	=> array(2, 4, 16),
		'23'	=> array(1, 2, 4, 16),
		'24'	=> array(8, 16),
		'25'	=> array(1, 8, 16),
		'26'	=> array(2, 8, 16),
		'27'	=> array(1, 2, 8, 16),
		'28'	=> array(4, 8, 16),
		'29'	=> array(1, 4, 8, 16),
		'30'	=> array(2, 4, 8, 16),
		'31'	=> array(1, 2, 4, 8, 16),
	);
	static $manager_group_arr = array(
		'Flash'	=> array(1),							// Flash
		'测试'	=> array(2),							// 测试
		'PHP'	=> array(4),							// PHP
		'技术'	=> array(1, 2, 4),						// 技术
		'原画'	=> array(8),							// 原画
		'UI'	=> array(16),							// UI
		'UI主管'	=> array(8, 16),						// SASA
		'运营'	=> array(32),							// 运营
		'副总'	=> array(1, 2, 4, 7, 8, 16, 24, 32),	// 副总
	);
}
global $__l;
Statics::$target_arr = array(
	'eBody'		=> '信息窗口',	// $__l['edit'].$__l['window'],
	'iBody'		=> '主窗口',	// $__l['list'].$__l['window'],
	'_self'		=> '当前窗口',	// $__l['self'].$__l['window'],
	'_parent'	=> '父级窗口',	// $__l['parent'].$__l['window'],
	'_blank'	=> '新窗口',	// $__l['new'].$__l['window'],
	'_top'		=> '顶层窗口',	// $__l['top'].$__l['window'],
);
Statics::$manager_level_arr = array(
	1	=> '等级1',	// $__l['level'].'1',
	2	=> '等级2',	// $__l['level'].'2',
	3	=> '等级3',	// $__l['level'].'3',
	4	=> '等级4',	// $__l['level'].'4',
);
Statics::$prototype_type_arr = Statics::$sysvar_type_arr;
Statics::$rgx = array(
	// 匹配
	'inte'		=> '/^\d+$/',	//非负整数
	'intx'		=> '/^[0-9]*[1-9][0-9]*$/',	//正整数
	'intm'		=> '/^((-\d+)|(0+))$/',	//非正整数
	'intl'		=> '/^-[0-9]*[1-9][0-9]*$/',	//负整数
	'int'		=> '/^-?\d+$/',	//整数
	'decmale'	=> '/^\d+(\.\d+)?$/',	//非负浮点数
	'decmalx'	=> '/^((0-9)+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/',	//正浮点数
	'decmalm'	=> '/^((-\d+\.\d+)?)|(0+(\.0+)?))$/',	//非正浮点数
	'decmall'	=> '/^(-((正浮点数正则式)))$/',	//负浮点数
	'letter'	=> '/^[A-Za-z]+$/',	//英文字符串
	'letterl'	=> '/^[A-Z]+$/',	//英文大写串
	'letteru'	=> '/^[a-z]+$/',	//英文小写串
	'word'		=> '/^[A-Za-z0-9]+$/',	//英文字符数字串
	'char'		=> '/^\w+$/',	//英数字加下划线串
	'email'		=> '/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/',	//E-mail地址
	'url'		=> '/^[a-zA-Z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\s*)?$ /',	//URL
	'zipcode'	=> '/^[1-9]\d{5}$/',	//邮政编码
	'chinese'	=> '/^[\u0391-\uFFE5]+$/',	//中文
	'tel'		=> '/^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/',	//电话号码
	'mobile'	=> '/^((\(\d{2,3}\))|(\d{3}\-))?13\d{9}$/',	//手机号码
	'orient'	=> '/^\x00-\xff/',	//双字节字符(包括汉字在内)
	'space'		=> '/(^\s*)|(\s*$)/',	//匹配首尾空格
	'html'		=> '/<(.*)>.*<\/\1>|<(.*) \/>/',	//匹配HTML标记
	'eline'		=> '/\n[\s| ]*\r/',	//匹配空行
	// 提取
	'href'		=> '/(h|H)(r|R)(e|E)(f|F) *= *(\'|")?(\w|\\|\/|\.)+(\'|"| *|>)?/',	//提取信息中的网络链接
	'_email'	=> '/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/',	//提取信息中的邮件地址
	'img'		=> '/(s|S)(r|R)(c|C) *= *(\'|")?(\w|\\|\/|\.)+(\'|"| *|>)?/',	//提取信息中的图片链接
	'ip'		=> '/ "^(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5]).(d{1,2}|1dd|2[0-4]d|25[0-5])$"/',	//提取信息中的IP地址
	'_mobile'	=> '/(86)?0?1[358]]\d{9}/',	//提取信息中的中国手机号码
	'_tel'		=> '/(\(\d{3,4}\)|\d{3,4}-|\s)?\d{8}/',	//提取信息中的中国固定电话号码
	'phone'		=> '/(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}/',	//提取信息中的中国电话号码（包括移动和固定电话）
	'_zipcode'	=> '/[1-9]{1}(\d+){5}/',	//提取信息中的中国邮政编码
	'_decmall'	=> '/(-?\d*)\.?\d+/',	//提取信息中的浮点数（即小数）
	'num'		=> '/(-?\d*)(\.\d+)?/',	//提取信息中的任何数字
	'ip'		=> '/(\d+)\.(\d+)\.(\d+)\.(\d+)/',	//IP
	//''		=> '//^0\d{2,3}$//',	//电话区号
	'qq'		=> '/^[1-9]*[1-9][0-9]*$/',	//腾讯QQ号
	'account'	=> '/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/',	//帐号(字母开头，允许5-16字节，允许字母数字下划线)
	'chars'		=> '/^[\u4e00-\u9fa5_a-zA-Z0-9]+$ /',	//中文、英文、数字及下划线
);
?>